/* 
 * File:   printformoperation.h
 * Author: oli
 *
 * Created on October 15, 2008, 5:17 PM
 */

#ifndef _PRINTFORMOPERATION_H
#define	_PRINTFORMOPERATION_H

#include <pangomm.h>
#include <gtkmm.h>
#include <vector>
#include "Device.h"

//We derive our own class from PrintOperation,
//so we can put the actual print implementation here.


class PrintFormOperation : public Gtk::PrintOperation {
public:
    static Glib::RefPtr<PrintFormOperation> create();
    virtual ~PrintFormOperation();

    void set_device(Device dev);


protected:
    PrintFormOperation();

    //PrintOperation default signal handler overrides:
    virtual void on_begin_print(const Glib::RefPtr<Gtk::PrintContext>& context);
    virtual void on_draw_page(const Glib::RefPtr<Gtk::PrintContext>& context, int page_nr);

    Device* deviceToPrint;
//    Glib::ustring dev_name;
//    Glib::ustring dev_comments;
//    Glib::ustring dev_vendor;
//    Glib::ustring dev_model;
//    Glib::ustring dev_size;
//    Glib::ustring dev_bus; // atm not in use
//
//    //tableau-parm vars
//    //## Bridge Information ##
//    Glib::ustring dev_bridge_chan_index;
//    Glib::ustring dev_bridge_chan_type;
//    bool dev_bridge_writes_permitted;
//    bool dev_bridge_declare_write_blocked;
//    bool dev_bridge_declare_write_errors;
//    Glib::ustring dev_bridge_serial;
//    Glib::ustring dev_bridge_vendor;
//    Glib::ustring dev_bridge_model;
//    Glib::ustring dev_bridge_firmware_date;
//    Glib::ustring dev_bridge_firmware_time;
//    // ## Drive Information ##
//    Glib::ustring dev_bridge_drive_vendor;
//    Glib::ustring dev_bridge_drive_model;
//    Glib::ustring dev_bridge_drive_serial;
//    Glib::ustring dev_bridge_drive_revision;
//
//    //## Drive HPA/DCO/Security Information ##
//    bool dev_bridge_security_in_use;
//    bool dev_bridge_security_support;
//    bool dev_bridge_hpa_in_use;
//    bool dev_bridge_hpa_support;
//    bool dev_bridge_dco_in_use;
//    bool dev_bridge_dco_support;
//    Glib::ustring dev_bridge_drive_capacity;
//    Glib::ustring dev_bridge_hpa_capacity;
//    Glib::ustring dev_bridge_dco_capacity;
//    Glib::ustring dev_bridge_dco_challenge_key;

    Glib::RefPtr<Pango::Layout> m_refLayout;
    std::vector<int> m_PageBreaks; // line numbers where a page break occurs
};

#endif	/* _PRINTFORMOPERATION_H */

